#include "VideoSourceTimerCallbackAdapter.h"

namespace TUMAR { namespace Render {
	VideoSourceTimerCallbackAdapter::VideoSourceTimerCallbackAdapter(TUMAR::MarkerTracking::VideoSource* video) : video(video)
	{
	}


	VideoSourceTimerCallbackAdapter::~VideoSourceTimerCallbackAdapter(void)
	{
	}

	void VideoSourceTimerCallbackAdapter::Start(void)
	{
		this->Schedule((int) this->video->GetFrameInterval());
	}

	void VideoSourceTimerCallbackAdapter::Tick(void) const
	{
		cv::Mat buffer;

		this->video->GetNextImage(buffer);

		this->ImageCaptured(buffer);
	}
}}